namespace DragonSolution.Web.UI.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class create : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Attachment",
                c => new
                    {
                        AttachmentID = c.Int(nullable: false, identity: true),
                        TableID = c.Int(nullable: false),
                        TableName = c.String(),
                        AttachmentName = c.String(),
                        AttachmentPath = c.String(),
                        AttachmentSize = c.Int(nullable: false),
                        IsDelete = c.Int(nullable: false),
                        CreateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.AttachmentID);
            
            CreateTable(
                "dbo.Category",
                c => new
                    {
                        CategoryID = c.Int(nullable: false, identity: true),
                        CategoryCode = c.String(),
                        CategoryName = c.String(),
                        ParentID = c.Int(nullable: false),
                        ParentCode = c.Int(nullable: false),
                        SubjectID = c.Int(nullable: false),
                        IsDelete = c.Int(nullable: false),
                        CreateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.CategoryID);
            
            CreateTable(
                "dbo.CompanyInfo",
                c => new
                    {
                        CompanyID = c.Int(nullable: false, identity: true),
                        CompanyName = c.String(),
                        CompanyBrief = c.String(),
                        CompanyTel = c.String(),
                        CompanyFax = c.String(),
                        CompanyEmail = c.String(),
                        CompanyAddr = c.String(),
                        CompanyCulture = c.String(),
                        CompanyHistory = c.String(),
                        CompanyIdea = c.String(),
                        CompanyContact = c.String(),
                    })
                .PrimaryKey(t => t.CompanyID);
            
            CreateTable(
                "dbo.Feedback",
                c => new
                    {
                        FeedbackID = c.Int(nullable: false, identity: true),
                        FeedbackName = c.String(),
                        FeedbackEmail = c.String(),
                        FeedbackTel = c.String(),
                        FeedbackContent = c.String(),
                        CreateDate = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.FeedbackID);
            
            CreateTable(
                "dbo.NewsInfo",
                c => new
                    {
                        NewsID = c.Int(nullable: false, identity: true),
                        NewsCategory = c.Int(nullable: false),
                        NewsName = c.String(),
                        NewsAuthor = c.String(),
                        NewsContent = c.String(),
                        NewsPostTime = c.DateTime(nullable: false),
                        IsDelete = c.Int(nullable: false),
                        IsTop = c.Int(nullable: false),
                        ViewNum = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.NewsID);
            
            CreateTable(
                "dbo.ProductInfo",
                c => new
                    {
                        ProductID = c.Int(nullable: false, identity: true),
                        ProductCategory = c.Int(nullable: false),
                        ProductName = c.String(),
                        ProductAuthor = c.String(),
                        ProductContent = c.String(),
                        ProductPostTime = c.DateTime(nullable: false),
                        IsDelete = c.Int(nullable: false),
                        IsTop = c.Int(nullable: false),
                        ViewNum = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.ProductID);
            
            CreateTable(
                "dbo.UserInfo",
                c => new
                    {
                        UserID = c.Int(nullable: false, identity: true),
                        UserCategory = c.Int(nullable: false),
                        UserName = c.String(),
                        UserPwd = c.String(),
                        CreateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.UserID);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.UserInfo");
            DropTable("dbo.ProductInfo");
            DropTable("dbo.NewsInfo");
            DropTable("dbo.Feedback");
            DropTable("dbo.CompanyInfo");
            DropTable("dbo.Category");
            DropTable("dbo.Attachment");
        }
    }
}
